/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.common.domain;


import io.swagger.annotations.ApiModelProperty;
import org.springframework.web.multipart.MultipartFile;

/**
 *  author: hjtan
 *  date: 2020-07-08
 */
public class MultipartFileParam {

    @ApiModelProperty(value = "总切片数量", name = "totalChunks")
    private Integer totalChunks;

    @ApiModelProperty(value = "当前切片索引, 从1开始", name = "chunkNumber")
    private Integer chunkNumber;

    @ApiModelProperty(value = "当前切片大小", name = "currentChunkSize")
    private Long currentChunkSize = 0L;

    @ApiModelProperty(value = "文件整体大小", name = "totalSize")
    private Long totalSize = 0L;

    @ApiModelProperty(value = "切片的大小", name = "chunkSize")
    private Long chunkSize = 0L;

    @ApiModelProperty(value = "文件标识符", name = "identifier")
    private String identifier;

    @ApiModelProperty(value = "文件名", name = "filename")
    private String filename;

    @ApiModelProperty(value = "文件相对路径", name = "relativePath")
    private String relativePath;

    @ApiModelProperty(value = "业务id", name = "businessId")
    private String businessId;

    @ApiModelProperty(value = "切片文件对象", name = "upfile")
    private MultipartFile upfile;

    @ApiModelProperty(value = "session id", name = "sessionId")
    private String sessionId;

    @ApiModelProperty(value = "是否来源于教育培训模块", name = "fromTraining")
    private boolean fromTraining = false;

    @ApiModelProperty(value = "附件所属模块", name = "attModel")
    private String attModel;

    public Integer getTotalChunks() {
        return totalChunks;
    }

    public void setTotalChunks(Integer totalChunks) {
        this.totalChunks = totalChunks;
    }

    public Integer getChunkNumber() {
        return chunkNumber;
    }

    public void setChunkNumber(Integer chunkNumber) {
        if (chunkNumber > 0) {
            chunkNumber--;
        }
        this.chunkNumber = chunkNumber;
    }

    public Long getCurrentChunkSize() {
        return currentChunkSize;
    }

    public void setCurrentChunkSize(Long currentChunkSize) {
        this.currentChunkSize = currentChunkSize;
    }

    public Long getTotalSize() {
        return totalSize;
    }

    public void setTotalSize(Long totalSize) {
        this.totalSize = totalSize;
    }

    public Long getChunkSize() {
        return chunkSize;
    }

    public void setChunkSize(Long chunkSize) {
        this.chunkSize = chunkSize;
    }

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    public String getRelativePath() {
        return relativePath;
    }

    public void setRelativePath(String relativePath) {
        this.relativePath = relativePath;
    }

    public String getBusinessId() {
        return businessId;
    }

    public void setBusinessId(String businessId) {
        this.businessId = businessId;
    }

    public MultipartFile getUpfile() {
        return upfile;
    }

    public void setUpfile(MultipartFile upfile) {
        this.upfile = upfile;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public boolean isFromTraining() {
        return fromTraining;
    }

    public void setFromTraining(boolean fromTraining) {
        this.fromTraining = fromTraining;
    }

    public String getAttModel() {
        return attModel;
    }

    public void setAttModel(String attModel) {
        this.attModel = attModel;
    }

    @Override
    public String toString() {
        return "MultipartFileParam{" +
                "totalChunks=" + totalChunks +
                ", chunkNumber=" + chunkNumber +
                ", currentChunkSize=" + currentChunkSize +
                ", totalSize=" + totalSize +
                ", chunkSize=" + chunkSize +
                ", identifier='" + identifier + '\'' +
                ", filename='" + filename + '\'' +
                ", relativePath='" + relativePath + '\'' +
                ", businessId='" + businessId + '\'' +
                ", upfile=" + upfile +
                ", sessionId='" + sessionId + '\'' +
                ", fromTraining=" + fromTraining +
                ", attModel='" + attModel + '\'' +
                '}';
    }

}
